package com.sirc.zp.domain;

import java.util.Date;
import java.util.List;

/**
 * Created by wpx on 2018/3/7.
 */
public class User {
    private Integer uid;//主键id
    private String username;//用户名
    private String password;// 密码
    private String type;//用户的类型：网站管理员1，家族管理员2，家族成员3
    private Integer belongs; //家族成员的所属：-9999是网站管理员，-1代表家族管理员，其他是家族管理员的id
    private String family;//家谱表的名称
    private Date createtime;//用户创建的时间
    private Date lasttime;//用户上次登录的时间
    private List<Role> roles;// 用户具备的角色

    public User() {
    }

    public User(Integer uid, String username, String password, String type, Integer belongs, String family, Date createtime, Date lasttime, List<Role> roles) {
        this.uid = uid;
        this.username = username;
        this.password = password;
        this.type = type;
        this.belongs = belongs;
        this.family = family;
        this.createtime = createtime;
        this.lasttime = lasttime;
        this.roles = roles;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getBelongs() {
        return belongs;
    }

    public void setBelongs(Integer belongs) {
        this.belongs = belongs;
    }

    public String getFamily() {
        return family;
    }

    public void setFamily(String family) {
        this.family = family;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getLasttime() {
        return lasttime;
    }

    public void setLasttime(Date lasttime) {
        this.lasttime = lasttime;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", type='" + type + '\'' +
                ", belongs=" + belongs +
                ", family='" + family + '\'' +
                ", createtime=" + createtime +
                ", lasttime=" + lasttime +
                ", roles=" + roles +
                '}';
    }
}
